home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / eiffel / smalleif.97 / se.t / SmallEiffel / lib_test / test_default_value.e < prev    next >
Encoding:
Text File  |  1996-05-02  |  1.5 KB  |  70 lines

  1. -- Part of SmallEiffel -- Read DISCLAIMER file -- Copyright (C) 
  2. -- Dominique COLNET and Suzanne COLLIN -- colnet@loria.fr
  3. --
  4. class TEST_DEFAULT_VALUE
  5.  
  6. creation {ANY}
  7.    make
  8.    
  9. feature {ANY}
  10.    
  11.    integer_attribute: INTEGER;
  12.    
  13.    reference_attribute: like Current;
  14.    
  15.    real_attribute: REAL;
  16.    
  17.    double_attribute: DOUBLE;
  18.    
  19.    boolean_attribute: BOOLEAN; 
  20.    
  21.    character_attribute: CHARACTER; 
  22.  
  23.    check_attribute is
  24.       do
  25.      is_true(integer_attribute = 0);
  26.      is_true(reference_attribute = Void);
  27.      is_true(real_attribute = 0.0);
  28.      is_true(double_attribute = 0.0);
  29.      is_true(boolean_attribute = false);
  30.      is_true(character_attribute = '%U');
  31.      
  32.       end;
  33.       
  34.    make is
  35.       local
  36.      integer_local: INTEGER;
  37.      reference_local: like Current;
  38.      real_local: REAL;
  39.      double_local: DOUBLE;
  40.      boolean_local: BOOLEAN; 
  41.      character_local: CHARACTER; 
  42.       do
  43.      is_true(integer_local = 0);
  44.      is_true(reference_local = Void);
  45.      is_true(real_local = 0.0);
  46.      is_true(double_local = 0.0);
  47.      is_true(boolean_local = false);
  48.      is_true(character_local = '%U');
  49.      
  50.      check_attribute;
  51.      standard_clone(Current).check_attribute;
  52.      clone(Current).check_attribute;
  53.       end;
  54.    
  55.    is_true(b: BOOLEAN) is
  56.       do
  57.      cpt := cpt + 1;
  58.      if not b then
  59.         std_output.put_string("TEST_DEFAULT_VALUE: ERROR Test # ");
  60.         std_output.put_integer(cpt);
  61.         std_output.put_string("%N");
  62.      else
  63.         -- std_output.put_string("Yes%N");
  64.      end;
  65.       end;
  66.    
  67.    cpt: INTEGER;
  68.    
  69. end -- TEST_DEFAULT_VALUE
  70.